#include "server.hpp"
#include "fstring.hpp"
#include <unistd.h>
#include <stdio.h>

int main(int argc, char** argv)
{
	int port = 1888;
	FString logDir = "/var/log/";
	char c;
	FString str;
	
	while( (c = getopt(argc, argv, "p:d:")) != EOF )
	{
		switch(c)
		{
			case 'p':
				str = optarg;
				port = str.toInt();
				break;
			case 'd':
				logDir = optarg;
				break;
		}
	}

	Server s(port, logDir);
	
	s.start();
	return 0;
}
